#include "gofgame/dungeonkeeper/ui/MessageViewDialog.h"
#include "gofgame/common/graphics/LinearGradientBrush.h"

using namespace gofgame::dungeonkeeper::ui;

MessageViewDialog::MessageViewDialog(MessageDialogType messageDialogType) 
	: MessageDialog(messageDialogType) {
	this->setOKText("");
	this->setCancelText("");
	this->setButtonHeight(70);
	Ref<CCTexture2D> okTexture = CCTextureCache::sharedTextureCache()->addImage("gofgame/dungeonkeeper/ui/ok_button.png");
	Ref<CCTexture2D> cancelTexture = CCTextureCache::sharedTextureCache()->addImage("gofgame/dungeonkeeper/ui/cancel_button.png");
	Ref<Brush> pressedBaseBrush;
	pressedBaseBrush.initialize(new LinearGradientBrush(0, 0, 0, 1, 1, 0, 0, 1));
	this->setButtonBackgroundBrush(new TextureBrush(okTexture, Brush::white()), MessageButtonType_OK);
	this->setButtonPressedBackgroundBrush(new TextureBrush(okTexture, pressedBaseBrush), MessageButtonType_OK);
	this->setButtonBackgroundBrush(new TextureBrush(cancelTexture, Brush::white()), MessageButtonType_Cancel);
	this->setButtonPressedBackgroundBrush(new TextureBrush(cancelTexture, pressedBaseBrush), MessageButtonType_Cancel);
}
